

package com.maoshi.shop.distribution.comment.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.maoshi.shop.distribution.comment.model.DistributionUserBind;
import com.maoshi.shop.distribution.comment.param.RangeTimeParam;

/**
 *
 * @author lgh on 2019/04/01.
 */
public interface DistributionUserBindService extends IService<DistributionUserBind> {
    IPage<DistributionUserBind> distributionMsgsAndUserPage(Page page, DistributionUserBind distributionUserBind, RangeTimeParam bindTime, RangeTimeParam invalidTime, String userName, String  parentName);

    /**
     * 获取绑定人id
     * @param shopId
     * @param userId
     * @param state
     * @return
     */
    Long getParentDistributionIdByShopIdAndUserId(Long shopId,String userId,Integer state);

    /**
     * 通过用户id和分销员id 尝试进行绑定,返回绑定结果
     * @param userId
     * @param distributionUserId
     */
    boolean bindingUser(String userId, Long distributionUserId, Long shopId);

    //合并代码开始
    void updateStateByUserId(String userId, Integer state);

    void insert(DistributionUserBind distributionUserBind);

    DistributionUserBind getByUserId(String userId);
    //合并代码结束

}
